using System.Collections.Generic;
using Microsoft.Xna.Framework.Content;

namespace RunGun
{
    /// <summary>
    /// Abstract base class to manage loading, unloading, drawing, and adding effects to 3d models.
    /// </summary>
    public abstract class ModelManagerBase
    {
        /// <summary>
        /// The game models
        /// </summary>
        protected IList<GameModelBase> gameModels;

        /// <summary>
        /// Initializes a new instance of the <see cref="ModelManagerBase"/> class.
        /// </summary>
        /// <param name="contentManager">The content manager.</param>
        protected ModelManagerBase(ContentManager contentManager)
        {
            ContentManager = contentManager;
        }

        /// <summary>
        /// Gets or sets the content manager.
        /// </summary>
        public ContentManager ContentManager { get; protected set; }

        /// <summary>
        /// Loads the model and returns the instance.
        /// </summary>
        /// <param name="modelName">Name of the model.</param>
        /// <param name="textureName">Name of the texture.</param>
        /// <param name="shaderName">Name of the shader.</param>
        public abstract void LoadModel<T>(string modelName, string textureName, string shaderName) 
            where T: IShaderEffect, new();

        /// <summary>
        /// Loads the shader effect with the given name.
        /// </summary>
        /// <param name="effectName">Name of the effect.</param>
        /// <returns>An IShaderEffect object with the specified shader effect.</returns>
        public abstract T LoadEffect<T>(string effectName) where T : IShaderEffect, new();

        /// <summary>
        /// Unloads the model from memory.
        /// </summary>
        /// <param name="modelName">Name of the model.</param>
        public abstract void UnloadModel(string modelName);

        /// <summary>
        /// Draws the game models.
        /// </summary>
        /// <param name="camera">The game camera.</param>
        public abstract void Draw(CameraBase camera);
    }
}